-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avatar styles #175
Avatar styles #175
Conversation
✅ Deploy Preview for reablocks-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/** | ||
* Whether the avatar is able to interact. | ||
*/ | ||
interactable?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be inverse of disable. No need for new prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases we don't neet user interaction with this component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is that different from disabled?
src/elements/Avatar/Avatar.tsx
Outdated
@@ -24,7 +23,7 @@ export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> { | |||
/** | |||
* Style variant for the avatar. | |||
*/ | |||
variant?: 'filled' | 'outline'; | |||
variant?: 'filled' | 'outline' | 'colored'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variant name could be better. Its not obvious whats different here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call this like primary
or maybe secondary
or something? this isn't a common name we use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
primary
or secondary
it's more about color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think still no. Its not obvious what this is and how its different from the others. Like filled
could mean colored
imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had color
property - now it is deprecated and moved to the variant
. Also, user can pass colorOptions
. IDK what you don't like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like colored
is the same things as filled
, but with a diff background color. Is that right?
if a user wanted the avatar filled, but with a diff background color than their globally styled filled
variant, it could be simpler for them to just pass an altered AvatarTheme to the component theme
prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like colored is the same things as filled, but with a diff background color. Is that right?
Yes
The reason was to make component similar to figma design without breaking the functionality. Let me rethink it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to tweak variant name
# Conflicts: # src/elements/Avatar/Avatar.story.tsx
I've moved it to the separate property |
src/elements/Avatar/Avatar.tsx
Outdated
/** | ||
* Style type for the avatar. | ||
*/ | ||
type: 'colored' | 'monochrome'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to fix type
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Issue Number: GOOD-186
Does this PR introduce a breaking change?